﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using webapp4U.BOL;

namespace webapp4U.UI.Controls
{
    public partial class ProductHomePage : System.Web.UI.UserControl
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            //Title11.TitleName = ResourceManager.GetString("Product_SanPhamMoi");              

            List<Products> obj = Products.GetProductHomePage();
            ItemsDataList.DataSource = obj;
            ItemsDataList.DataBind();
        }

        protected string GetPrice(decimal UnitPrice)
        {
            if (UnitPrice > 0)
                return Formatter.FormatMoney(UnitPrice).ToString() + " VNĐ";
            else
                return ResourceManager.GetString("Product_Price_Lienhe");
        }
       
        protected string GetButtonAddToCart(Decimal UnitPrice)
        {
            if (UnitPrice > 0)
                if (Globals.LangVietNam())
                    return "<img src=" + Globals.ImagesUrl() + "AddToCart_nho.gif border=0 />";
                else
                    return "<img src=" + Globals.ImagesUrl() + "AddToCart_nho_en.gif border=0 />";
            return "";
        }

    }
}